<script setup lang="ts">
import type { EaWorkType } from './type'
import { Picture } from '@element-plus/icons-vue'
import { buildImgSrc, imageBindSrc } from '@/utils/file'

const baseApi = '/ea/ea-work-type'

const { loadData, loading, model } = useDetail<EaWorkType>(baseApi)

defineExpose({ init: loadData })
</script>

<template>
  <el-empty v-if="!Object.keys(model).length" v-loading="loading" />
  <el-descriptions v-else v-loading="loading" :column="2" border>
    <el-descriptions-item label="上级" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.parentIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="分类名" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.title }}
      </span>
    </el-descriptions-item>
    <!--    <el-descriptions-item label="备注说明" label-class-name="item-label" label-align="right">
          <span class="txt-short">
            {{ model.remark }}
          </span>
        </el-descriptions-item>
        <el-descriptions-item label="是否需要证件照" label-class-name="item-label" label-align="right">
          <template v-if="model.isNeed != null">
            {{ model.isNeed ? '是' : '否' }}
          </template>
        </el-descriptions-item>-->
    <el-descriptions-item label="建议价格" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.suggestedPrice }}
      </span>
    </el-descriptions-item>
    <!--    <el-descriptions-item label="状态" label-class-name="item-label" label-align="right">
          <el-tag v-if="model.statusLabel" :color="model.statusLabel.ext?.color" effect="dark" type="info">
            {{ model.statusLabel?.label }}
          </el-tag>
        </el-descriptions-item>-->
  </el-descriptions>
</template>

<style scoped lang="scss">
.el-descriptions {
  :deep(.el-descriptions__header) {
    margin: 0 10px 12px;
  }

  :deep(.item-label) {
    width: 130px;
  }

  .el-image {
    width: 150px;
    height: 150px;
    border-radius: 6px;
    box-sizing: border-box;
    border: 1px solid var(--el-border-color);
  }
}
</style>
